//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.ScientificWorkflow.ManagementStudioModels
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.ComponentModel;


    public class CredentialModel : INotifyPropertyChanged
    {
        private string name;
        private string displayName;
        private bool isTestSuccceeded;
        private bool isTestfailed;

        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
                this.RaisePropertyChanged("Name");
            }
        }

        public string DisplayName
        {
            get
            {
                return this.displayName;
            }
            set
            {
                this.displayName = value;
                this.RaisePropertyChanged("DisplayName");
            }
        }

        public bool IsTestSucceeded
        {
            get
            {
                return this.isTestSuccceeded;
            }
            set
            {
                this.isTestSuccceeded = value;
                this.RaisePropertyChanged("IsTestSucceeded");
            }
        }

        public bool IsTestFailed
        {
            get
            {
                return this.isTestfailed;
            }
            set
            {
                this.isTestfailed = value;
                this.RaisePropertyChanged("IsTestFailed");
            }
        }


        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        public void RaisePropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        }
        #endregion
    }

    public class LogOnCredentialModel 
    {
        private string name;
        private string displayName;
        public LogOnCredentialModel(string name, string displayName)
        {
            this.CredentialName = name;
            this.CredentialDisplayName = displayName;
        }

        public string CredentialName
        {
            get { return this.name; }
            set
            {
                this.name = value;
            }
        }

        public string CredentialDisplayName
        {
            get { return this.displayName; }
            set
            {
                this.displayName = value;
            }
        }

        /// <summary>
        /// override method for ToString
        /// </summary>
        /// <returns>name</returns>
        public override string ToString()
        {
            return this.name;
        }
    }


    public class CredentialRoleModel
    {
        public CredentialRoleModel(string name, bool isSelected)
        {
            this.RoleName = name;
            this.RoleSelected = isSelected;
        }

        public string RoleName { get; set; }

        public bool RoleSelected { get; set; }

        /// <summary>
        /// override method for ToString
        /// </summary>
        /// <returns>RoleName</returns>
        public override string ToString()
        {
            return this.RoleName;
        }
    }

    public class CredentialGroupModel
    {
        public CredentialGroupModel(string name, bool isSelected)
        {
            this.GroupName = name;
            this.IsSelected = isSelected;
        }

        public string GroupName { get; set; }

        public bool IsSelected { get; set; }

        /// <summary>
        /// override method for ToString
        /// </summary>
        /// <returns>GroupName</returns>
        public override string ToString()
        {
            return this.GroupName;
        }
    }

    public class SelectUserModel
    {
        public SelectUserModel(string name, Guid id)
        {
            this.UserName = name;
            this.Id = id;
        }

        public string UserName { get; set; }

        public Guid Id { get; set; }

        /// <summary>
        /// override method for ToString
        /// </summary>
        /// <returns>UserName</returns>
        public override string ToString()
        {
            return this.UserName;
        }
    }

    public class SelectGroupModel
    {
        public SelectGroupModel(string name, Guid id)
        {
            this.GroupName = name;
            this.Id = id;
        }

        public string GroupName { get; set; }

        public Guid Id { get; set; }
    }

    public class SearchUserModel
    {
        /// <summary>
        /// Sonstructor
        /// </summary>
        /// <param name="name">User Name</param>
        /// <param name="displayName"> Display Name</param>
        /// <param name="domainName">Domain name</param>
        public SearchUserModel(string name, string displayName, string domainName)
        {
            this.UserName = name;
            this.DisplayName = displayName;
            this.DomainName = domainName;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">user name</param>
        public SearchUserModel(string name)
        {
            this.UserName = name;
        }

        public string UserName { get; set; }
        public string DomainName { get; set; }
        public string DisplayName { get; set; }

        /// <summary>
        /// override method for ToString
        /// </summary>
        /// <returns>UserName</returns>
        public override string ToString()
        {
            return this.UserName;
        }
    }
}
